package com.hsc.yalebao.tabMine;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.MessageTitleBean;
import com.hsc.yalebao.model.MessageTitleBean.ResultBean;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.weight.LogUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.PrintStream;
import java.util.HashMap;
import okhttp3.Call;

public class DetailMessageActivity extends BaseActivity
{
  private String TAG = "DetailMessageActivity";
  private MessageTitleBean.ResultBean bean;
  private View contentView;
  private Context context;
  private ImageView iv_title_right;
  int memberid;
  private String msgType;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099704:
      default:
        return;
      case 2131099699:
      }
      CustomApplication.app.finishActivity(DetailMessageActivity.this);
    }
  };
  private TextView tv_content;
  private TextView tv_time;
  private TextView tv_title;

  private void initData()
  {
    if ((getIntent().getSerializableExtra("message") instanceof MessageTitleBean.ResultBean))
    {
      this.bean = ((MessageTitleBean.ResultBean)getIntent().getSerializableExtra("message"));
      if (this.bean != null)
      {
        this.tv_title.setText(this.bean.Title);
        this.tv_time.setText(this.bean.Add_Time);
        this.tv_content.setText(this.bean.Message);
      }
    }
    markMessage();
  }

  private void initView()
  {
    this.msgType = getIntent().getStringExtra("MsgType");
    this.tv_title = ((TextView)this.contentView.findViewById(2131099849));
    this.tv_time = ((TextView)this.contentView.findViewById(2131099850));
    this.tv_content = ((TextView)this.contentView.findViewById(2131099851));
    if ("tongzhi".equals(this.msgType))
    {
      setTitle(8, 0, 2130837809, "公告详情", 0, 8, 8, 0, true);
      return;
    }
    setTitle(8, 0, 2130837809, "消息内容", 0, 8, 8, 0, true);
  }

  private void markMessage()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("messageid", this.bean.Id);
    localHashMap.put("memberid", this.memberid);
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_USER_UPDATEISREAD);
    RequestNet.get(this.context, AppConstants.URL_USER_UPDATEISREAD, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(DetailMessageActivity.this.TAG, "网络故障,markMessage-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.i(DetailMessageActivity.this.TAG, "标记联网成功" + paramAnonymousString);
        if ((paramAnonymousString == null) || ("".equals(paramAnonymousString)))
          LogUtils.e(DetailMessageActivity.this.TAG, "标记结果失败result:" + paramAnonymousString);
        MessageTitleBean localMessageTitleBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localMessageTitleBean = (MessageTitleBean)localGson.fromJson(paramAnonymousString, MessageTitleBean.class);
            if (localMessageTitleBean == null)
            {
              LogUtils.e(DetailMessageActivity.this.TAG, "markMessage == null，获取失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localMessageTitleBean = null;
            }
            System.out.println("获取flag=" + localMessageTitleBean.flag);
            if (localMessageTitleBean.flag == -2)
            {
              DetailMessageActivity.this.showDownWireDialog();
              return;
            }
            if (localMessageTitleBean.flag == -3)
            {
              DetailMessageActivity.this.ShowFengjinDialog();
              return;
            }
            if (localMessageTitleBean.flag == -4)
            {
              DetailMessageActivity.activityStack.backToMain(MainActivity.class, DetailMessageActivity.this.context);
              return;
            }
          }
        }
        while (localMessageTitleBean.flag != 1);
        System.out.println("标记成功");
      }
    });
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.context = this;
    this.contentView = LayoutInflater.from(this.context).inflate(2130903056, null);
    setContentView(this.contentView);
    CustomApplication.app.addActivity(this);
    initView();
    if (CustomApplication.app.userBaseBean != null)
      this.memberid = CustomApplication.app.userBaseBean.getMemberid();
    initData();
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      ((TextView)localView.findViewById(2131099701)).setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt5);
      localTextView.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabMine.DetailMessageActivity
 * JD-Core Version:    0.6.2
 */